import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '副产品名称',
    align: "center",
    dataIndex: 'productName'
  },
  {
    title: '库存（ kg ）',
    align: "center",
    dataIndex: 'productStock'
  },
  {
    title: '所属产品',
    align: "center",
    dataIndex: 'requiredMaterial_dictText'
  },
  {
    title: '蛋白质 ( % )',
    align: "center",
    dataIndex: 'protein'
  },
  {
    title: '水分 ( % )',
    align: "center",
    dataIndex: 'moisture'
  },
  {
    title: '氨基酸 ( % )',
    align: "center",
    dataIndex: 'aminoAcid'
  },
  {
    title: '糖分 ( % )',
    align: "center",
    dataIndex: 'sugar'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "副产品名称",
    field: 'productName',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '副产品名称',
    field: 'productName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入副产品名称!'},
             ];
    },
  },
  {
    label: '库存',
    field: 'productStock',
    component: 'InputNumber',
  },
  {
    label: '规格',
    field: 'stockUnit',
    component: 'Input',
  },
  {
    label: '所属产品',
    field: 'requiredMaterial',
    component: 'JSelectMultiple',
    componentProps:{
      dictCode: "camellia_mes_product,name,id"
    },
  },
  {
    label: '蛋白质',
    field: 'protein',
    component: 'Input',
  },
  {
    label: '水分',
    field: 'moisture',
    component: 'Input',
  },
  {
    label: '氨基酸',
    field: 'aminoAcid',
    component: 'Input',
  },
  {
    label: '糖分',
    field: 'sugar',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
